file(GLOB SRC_FILES "*.cpp" "*.c")

add_subdirectory("./TcpServer")
add_subdirectory("./FTPServer")

foreach(SRC_FILE ${SRC_FILES})
    get_filename_component(EXE_NAME ${SRC_FILE} NAME_WE)

    add_executable(${EXE_NAME} ${SRC_FILE})

    target_include_directories(${EXE_NAME} PRIVATE
        ${CMAKE_SOURCE_DIR}/libevent/include
        ${CMAKE_SOURCE_DIR}/libevent
        ${CMAKE_SOURCE_TcpServer_Dir}
    )

    target_link_libraries(${EXE_NAME} PRIVATE
        event_extra
        TcpServer
        event_core
    )
    if(NOT WIN32)
        target_link_libraries(${EXE_NAME} PRIVATE
            pthread
        )
    endif()
endforeach()
